package main

import (
	"encoding/json"
	"fmt"
)

func main1() {
	jsonData := []byte(`{
    "apiVersion": "v1",
    "items": [
        {
            "apiVersion": "v1",
            "kind": "Pod",
            "metadata": {
                "annotations": {
                    "k8s.v1.cni.cncf.io/network-status": "[{\n    \"name\": \"cbr0\",\n    \"interface\": \"eth0\",\n    \"ips\": [\n        \"10.202.0.120\"\n    ],\n    \"mac\": \"6e:47:42:c6:df:ff\",\n    \"default\": true,\n    \"dns\": {}\n}]",
                    "k8s.v1.cni.cncf.io/networks-status": "[{\n    \"name\": \"cbr0\",\n    \"interface\": \"eth0\",\n    \"ips\": [\n        \"10.202.0.120\"\n    ],\n    \"mac\": \"6e:47:42:c6:df:ff\",\n    \"default\": true,\n    \"dns\": {}\n}]"
                },
                "creationTimestamp": "2022-04-24T05:32:25Z",
                "generateName": "direct-test-6457db8477-",
                "labels": {
                    "app": "direct-test",
                    "pod-template-hash": "6457db8477"
                },
                "managedFields": [
                    {
                        "apiVersion": "v1",
                        "fieldsType": "FieldsV1",
                        "fieldsV1": {
                            "f:metadata": {
                                "f:generateName": {},
                                "f:labels": {
                                    ".": {},
                                    "f:app": {},
                                    "f:pod-template-hash": {}
                                },
                                "f:ownerReferences": {
                                    ".": {},
                                    "k:{\"uid\":\"3240aeda-106f-4820-891e-0ad66e91ee38\"}": {
                                        ".": {},
                                        "f:apiVersion": {},
                                        "f:blockOwnerDeletion": {},
                                        "f:controller": {},
                                        "f:kind": {},
                                        "f:name": {},
                                        "f:uid": {}
                                    }
                                }
                            },
                            "f:spec": {
                                "f:containers": {
                                    "k:{\"name\":\"kubectl\"}": {
                                        ".": {},
                                        "f:command": {},
                                        "f:image": {},
                                        "f:imagePullPolicy": {},
                                        "f:name": {},
                                        "f:resources": {},
                                        "f:terminationMessagePath": {},
                                        "f:terminationMessagePolicy": {}
                                    }
                                },
                                "f:dnsPolicy": {},
                                "f:enableServiceLinks": {},
                                "f:restartPolicy": {},
                                "f:schedulerName": {},
                                "f:securityContext": {},
                                "f:terminationGracePeriodSeconds": {}
                            }
                        },
                        "manager": "kube-controller-manager",
                        "operation": "Update",
                        "time": "2022-04-24T05:32:25Z"
                    },
                    {
                        "apiVersion": "v1",
                        "fieldsType": "FieldsV1",
                        "fieldsV1": {
                            "f:metadata": {
                                "f:annotations": {
                                    ".": {},
                                    "f:k8s.v1.cni.cncf.io/network-status": {},
                                    "f:k8s.v1.cni.cncf.io/networks-status": {}
                                }
                            }
                        },
                        "manager": "multus",
                        "operation": "Update",
                        "time": "2022-04-24T05:32:27Z"
                    },
                    {
                        "apiVersion": "v1",
                        "fieldsType": "FieldsV1",
                        "fieldsV1": {
                            "f:status": {
                                "f:conditions": {
                                    "k:{\"type\":\"ContainersReady\"}": {
                                        ".": {},
                                        "f:lastProbeTime": {},
                                        "f:lastTransitionTime": {},
                                        "f:status": {},
                                        "f:type": {}
                                    },
                                    "k:{\"type\":\"Initialized\"}": {
                                        ".": {},
                                        "f:lastProbeTime": {},
                                        "f:lastTransitionTime": {},
                                        "f:status": {},
                                        "f:type": {}
                                    },
                                    "k:{\"type\":\"Ready\"}": {
                                        ".": {},
                                        "f:lastProbeTime": {},
                                        "f:lastTransitionTime": {},
                                        "f:status": {},
                                        "f:type": {}
                                    }
                                },
                                "f:containerStatuses": {},
                                "f:hostIP": {},
                                "f:phase": {},
                                "f:podIP": {},
                                "f:podIPs": {
                                    ".": {},
                                    "k:{\"ip\":\"10.202.0.120\"}": {
                                        ".": {},
                                        "f:ip": {}
                                    }
                                },
                                "f:startTime": {}
                            }
                        },
                        "manager": "kubelet",
                        "operation": "Update",
                        "time": "2022-04-24T11:25:15Z"
                    }
                ],
                "name": "direct-test-6457db8477-k2gnk",
                "namespace": "default",
                "ownerReferences": [
                    {
                        "apiVersion": "apps/v1",
                        "blockOwnerDeletion": true,
                        "controller": true,
                        "kind": "ReplicaSet",
                        "name": "direct-test-6457db8477",
                        "uid": "3240aeda-106f-4820-891e-0ad66e91ee38"
                    }
                ],
                "resourceVersion": "1018493",
                "selfLink": "/api/v1/namespaces/default/pods/direct-test-6457db8477-k2gnk",
                "uid": "5f9a3035-c220-4c42-848d-521765570be3"
            },
            "spec": {
                "containers": [
                    {
                        "command": [
                            "sleep",
                            "36000"
                        ],
                        "image": "192.168.0.202:5000/bitnami/kubectl:1.19.14",
                        "imagePullPolicy": "IfNotPresent",
                        "name": "kubectl",
                        "resources": {},
                        "terminationMessagePath": "/dev/termination-log",
                        "terminationMessagePolicy": "File",
                        "volumeMounts": [
                            {
                                "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
                                "name": "default-token-bqj9q",
                                "readOnly": true
                            }
                        ]
                    }
                ],
                "dnsPolicy": "ClusterFirst",
                "enableServiceLinks": true,
                "nodeName": "wfdz-pc",
                "preemptionPolicy": "PreemptLowerPriority",
                "priority": 0,
                "restartPolicy": "Always",
                "schedulerName": "default-scheduler",
                "securityContext": {},
                "serviceAccount": "default",
                "serviceAccountName": "default",
                "terminationGracePeriodSeconds": 30,
                "tolerations": [
                    {
                        "effect": "NoExecute",
                        "key": "node.kubernetes.io/not-ready",
                        "operator": "Exists",
                        "tolerationSeconds": 300
                    },
                    {
                        "effect": "NoExecute",
                        "key": "node.kubernetes.io/unreachable",
                        "operator": "Exists",
                        "tolerationSeconds": 300
                    }
                ],
                "volumes": [
                    {
                        "name": "default-token-bqj9q",
                        "secret": {
                            "defaultMode": 420,
                            "secretName": "default-token-bqj9q"
                        }
                    }
                ]
            },
            "status": {
                "conditions": [
                    {
                        "lastProbeTime": null,
                        "lastTransitionTime": "2022-04-24T05:32:25Z",
                        "status": "True",
                        "type": "Initialized"
                    },
                    {
                        "lastProbeTime": null,
                        "lastTransitionTime": "2022-04-24T11:25:13Z",
                        "status": "True",
                        "type": "Ready"
                    },
                    {
                        "lastProbeTime": null,
                        "lastTransitionTime": "2022-04-24T11:25:13Z",
                        "status": "True",
                        "type": "ContainersReady"
                    },
                    {
                        "lastProbeTime": null,
                        "lastTransitionTime": "2022-04-24T05:32:25Z",
                        "status": "True",
                        "type": "PodScheduled"
                    }
                ],
                "containerStatuses": [
                    {
                        "containerID": "docker://d02d1a5da3f6703d7834b37be7906509e2d4cfb8590b7c5a44ecbc2bc73535ac",
                        "image": "192.168.0.202:5000/bitnami/kubectl:1.19.14",
                        "imageID": "docker-pullable://192.168.0.202:5000/bitnami/kubectl@sha256:e4259e8b773b61eea1c72feb971f27c8fef3029a263eecff8c226fb375d8665b",
                        "lastState": {
                            "terminated": {
                                "containerID": "docker://e57e5352705d3403f90cfd5d47fb02a3bb3807534125e4bd5a1dde9b12c08e70",
                                "exitCode": 137,
                                "finishedAt": "2022-04-24T11:18:55Z",
                                "reason": "Error",
                                "startedAt": "2022-04-24T05:32:28Z"
                            }
                        },
                        "name": "kubectl",
                        "ready": true,
                        "restartCount": 1,
                        "started": true,
                        "state": {
                            "running": {
                                "startedAt": "2022-04-24T11:25:07Z"
                            }
                        }
                    }
                ],
                "hostIP": "192.168.0.202",
                "phase": "Running",
                "podIP": "10.202.0.120",
                "podIPs": [
                    {
                        "ip": "10.202.0.120"
                    }
                ],
                "qosClass": "BestEffort",
                "startTime": "2022-04-24T05:32:25Z"
            }
        },
        {
            "apiVersion": "v1",
            "kind": "Pod",
            "metadata": {
                "annotations": {
                    "cdi.kubevirt.io/storage.createdByController": "yes"
                },
                "creationTimestamp": "2022-04-24T10:29:11Z",
                "labels": {
                    "app": "containerized-data-importer",
                    "cdi.kubevirt.io": "importer",
                    "prometheus.cdi.kubevirt.io": ""
                },
                "managedFields": [
                    {
                        "apiVersion": "v1",
                        "fieldsType": "FieldsV1",
                        "fieldsV1": {
                            "f:metadata": {
                                "f:annotations": {
                                    ".": {},
                                    "f:cdi.kubevirt.io/storage.createdByController": {}
                                },
                                "f:labels": {
                                    ".": {},
                                    "f:app": {},
                                    "f:cdi.kubevirt.io": {},
                                    "f:prometheus.cdi.kubevirt.io": {}
                                },
                                "f:ownerReferences": {
                                    ".": {},
                                    "k:{\"uid\":\"dc87694e-27e3-492f-a541-7a50627e567f\"}": {
                                        ".": {},
                                        "f:apiVersion": {},
                                        "f:blockOwnerDeletion": {},
                                        "f:controller": {},
                                        "f:kind": {},
                                        "f:name": {},
                                        "f:uid": {}
                                    }
                                }
                            },
                            "f:spec": {
                                "f:containers": {
                                    "k:{\"name\":\"importer\"}": {
                                        ".": {},
                                        "f:args": {},
                                        "f:env": {
                                            ".": {},
                                            "k:{\"name\":\"FILESYSTEM_OVERHEAD\"}": {
                                                ".": {},
                                                "f:name": {},
                                                "f:value": {}
                                            },
                                            "k:{\"name\":\"IMPORTER_BACKING_FILE\"}": {
                                                ".": {},
                                                "f:name": {}
                                            },
                                            "k:{\"name\":\"IMPORTER_CONTENTTYPE\"}": {
                                                ".": {},
                                                "f:name": {},
                                                "f:value": {}
                                            },
                                            "k:{\"name\":\"IMPORTER_DISK_ID\"}": {
                                                ".": {},
                                                "f:name": {}
                                            },
                                            "k:{\"name\":\"IMPORTER_ENDPOINT\"}": {
                                                ".": {},
                                                "f:name": {},
                                                "f:value": {}
                                            },
                                            "k:{\"name\":\"IMPORTER_IMAGE_SIZE\"}": {
                                                ".": {},
                                                "f:name": {},
                                                "f:value": {}
                                            },
                                            "k:{\"name\":\"IMPORTER_SOURCE\"}": {
                                                ".": {},
                                                "f:name": {},
                                                "f:value": {}
                                            },
                                            "k:{\"name\":\"IMPORTER_THUMBPRINT\"}": {
                                                ".": {},
                                                "f:name": {}
                                            },
                                            "k:{\"name\":\"IMPORTER_UUID\"}": {
                                                ".": {},
                                                "f:name": {}
                                            },
                                            "k:{\"name\":\"INSECURE_TLS\"}": {
                                                ".": {},
                                                "f:name": {},
                                                "f:value": {}
                                            },
                                            "k:{\"name\":\"OWNER_UID\"}": {
                                                ".": {},
                                                "f:name": {},
                                                "f:value": {}
                                            }
                                        },
                                        "f:image": {},
                                        "f:imagePullPolicy": {},
                                        "f:name": {},
                                        "f:ports": {
                                            ".": {},
                                            "k:{\"containerPort\":8443,\"protocol\":\"TCP\"}": {
                                                ".": {},
                                                "f:containerPort": {},
                                                "f:name": {},
                                                "f:protocol": {}
                                            }
                                        },
                                        "f:resources": {
                                            ".": {},
                                            "f:limits": {
                                                ".": {},
                                                "f:cpu": {},
                                                "f:memory": {}
                                            },
                                            "f:requests": {
                                                ".": {},
                                                "f:cpu": {},
                                                "f:memory": {}
                                            }
                                        },
                                        "f:terminationMessagePath": {},
                                        "f:terminationMessagePolicy": {},
                                        "f:volumeDevices": {
                                            ".": {},
                                            "k:{\"devicePath\":\"/dev/cdi-block-volume\"}": {
                                                ".": {},
                                                "f:devicePath": {},
                                                "f:name": {}
                                            }
                                        }
                                    }
                                },
                                "f:dnsPolicy": {},
                                "f:enableServiceLinks": {},
                                "f:nodeSelector": {
                                    ".": {},
                                    "f:kubernetes.io/os": {}
                                },
                                "f:restartPolicy": {},
                                "f:schedulerName": {},
                                "f:securityContext": {
                                    ".": {},
                                    "f:fsGroup": {},
                                    "f:runAsUser": {}
                                },
                                "f:terminationGracePeriodSeconds": {},
                                "f:volumes": {
                                    ".": {},
                                    "k:{\"name\":\"cdi-data-vol\"}": {
                                        ".": {},
                                        "f:name": {},
                                        "f:persistentVolumeClaim": {
                                            ".": {},
                                            "f:claimName": {}
                                        }
                                    }
                                }
                            }
                        },
                        "manager": "cdi-controller",
                        "operation": "Update",
                        "time": "2022-04-24T10:29:11Z"
                    },
                    {
                        "apiVersion": "v1",
                        "fieldsType": "FieldsV1",
                        "fieldsV1": {
                            "f:status": {
                                "f:conditions": {
                                    ".": {},
                                    "k:{\"type\":\"PodScheduled\"}": {
                                        ".": {},
                                        "f:lastProbeTime": {},
                                        "f:lastTransitionTime": {},
                                        "f:message": {},
                                        "f:reason": {},
                                        "f:status": {},
                                        "f:type": {}
                                    }
                                }
                            }
                        },
                        "manager": "kube-scheduler",
                        "operation": "Update",
                        "time": "2022-04-24T10:29:11Z"
                    }
                ],
                "name": "importer-test-pod-pvc",
                "namespace": "default",
                "ownerReferences": [
                    {
                        "apiVersion": "v1",
                        "blockOwnerDeletion": true,
                        "controller": true,
                        "kind": "PersistentVolumeClaim",
                        "name": "test-pod-pvc",
                        "uid": "dc87694e-27e3-492f-a541-7a50627e567f"
                    }
                ],
                "resourceVersion": "994588",
                "selfLink": "/api/v1/namespaces/default/pods/importer-test-pod-pvc",
                "uid": "3d604a29-3149-4090-b835-8d3da805bdea"
            },
            "spec": {
                "containers": [
                    {
                        "args": [
                            "-v=1"
                        ],
                        "env": [
                            {
                                "name": "IMPORTER_SOURCE",
                                "value": "http"
                            },
                            {
                                "name": "IMPORTER_ENDPOINT",
                                "value": "http://192.168.0.98/kylin/uos-1040-B1-server-220311.iso"
                            },
                            {
                                "name": "IMPORTER_CONTENTTYPE",
                                "value": "kubevirt"
                            },
                            {
                                "name": "IMPORTER_IMAGE_SIZE",
                                "value": "10Gi"
                            },
                            {
                                "name": "OWNER_UID",
                                "value": "d122c72b-a1e8-42e2-b0f6-f9684e982b07"
                            },
                            {
                                "name": "FILESYSTEM_OVERHEAD",
                                "value": "0"
                            },
                            {
                                "name": "INSECURE_TLS",
                                "value": "false"
                            },
                            {
                                "name": "IMPORTER_DISK_ID"
                            },
                            {
                                "name": "IMPORTER_UUID"
                            },
                            {
                                "name": "IMPORTER_BACKING_FILE"
                            },
                            {
                                "name": "IMPORTER_THUMBPRINT"
                            }
                        ],
                        "image": "192.168.0.98:8888/kubevirt/cdi-importer:v1.26.1",
                        "imagePullPolicy": "IfNotPresent",
                        "name": "importer",
                        "ports": [
                            {
                                "containerPort": 8443,
                                "name": "metrics",
                                "protocol": "TCP"
                            }
                        ],
                        "resources": {
                            "limits": {
                                "cpu": "0",
                                "memory": "0"
                            },
                            "requests": {
                                "cpu": "0",
                                "memory": "0"
                            }
                        },
                        "terminationMessagePath": "/dev/termination-log",
                        "terminationMessagePolicy": "File",
                        "volumeDevices": [
                            {
                                "devicePath": "/dev/cdi-block-volume",
                                "name": "cdi-data-vol"
                            }
                        ],
                        "volumeMounts": [
                            {
                                "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
                                "name": "default-token-bqj9q",
                                "readOnly": true
                            }
                        ]
                    }
                ],
                "dnsPolicy": "ClusterFirst",
                "enableServiceLinks": true,
                "nodeSelector": {
                    "kubernetes.io/os": "linux"
                },
                "preemptionPolicy": "PreemptLowerPriority",
                "priority": 0,
                "restartPolicy": "OnFailure",
                "schedulerName": "default-scheduler",
                "securityContext": {
                    "fsGroup": 107,
                    "runAsUser": 0
                },
                "serviceAccount": "default",
                "serviceAccountName": "default",
                "terminationGracePeriodSeconds": 30,
                "tolerations": [
                    {
                        "effect": "NoExecute",
                        "key": "node.kubernetes.io/not-ready",
                        "operator": "Exists",
                        "tolerationSeconds": 300
                    },
                    {
                        "effect": "NoExecute",
                        "key": "node.kubernetes.io/unreachable",
                        "operator": "Exists",
                        "tolerationSeconds": 300
                    }
                ],
                "volumes": [
                    {
                        "name": "cdi-data-vol",
                        "persistentVolumeClaim": {
                            "claimName": "test-pod-pvc"
                        }
                    },
                    {
                        "name": "default-token-bqj9q",
                        "secret": {
                            "defaultMode": 420,
                            "secretName": "default-token-bqj9q"
                        }
                    }
                ]
            },
            "status": {
                "conditions": [
                    {
                        "lastProbeTime": null,
                        "lastTransitionTime": "2022-04-24T10:29:11Z",
                        "message": "0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.",
                        "reason": "Unschedulable",
                        "status": "False",
                        "type": "PodScheduled"
                    }
                ],
                "phase": "Pending",
                "qosClass": "BestEffort"
            }
        }
    ],
    "kind": "List",
    "metadata": {
        "resourceVersion": "",
        "selfLink": ""
    }
}
`)

	var v interface{}
	json.Unmarshal(jsonData, &v)
	resultResult := v.(map[string]interface{})
	items := resultResult["items"].([]interface{})
	for _, value := range items {
		value.((map[string]interface{}))["kind"] = "123"
		fmt.Println(value)
	}
	//fmt.Println(items)
}
